package com.zhuchaooasystem.adapter.holder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.zhuchaooasystem.R;
import com.zhuchaooasystem.entity.SignListEntity;

/**
 * @author yinsi
 */
public class SignListItemHolder extends BaseViewHolder<SignListEntity.ResultBean.SuccessfulBean.ListdataBean.DetailsBean> {
    private TextView txt_time;
    private TextView txt_address;
    private TextView txt_desc;

    public SignListItemHolder(ViewGroup parent) {
        super(parent, R.layout.item_activity_sign_list_detail);
        //----
        txt_time = $(R.id.item_act_sign_list_detail_txt_time);
        txt_address = $(R.id.item_act_sign_list_detail_txt_address);
        txt_desc = $(R.id.item_act_sign_list_detail_txt_desc);
    }

    @Override
    public void setData(final SignListEntity.ResultBean.SuccessfulBean.ListdataBean.DetailsBean data) {
        txt_time.setText(data.getTime());
        txt_address.setText("(" + data.getAddress() + ")");
        if (data.isIsShowFlow()) {
            txt_desc.setVisibility(View.VISIBLE);
            txt_desc.setText(data.getServiceSign() + " > " + data.getServiceId() + "  " + data.getServiceName());
        } else {
            txt_desc.setVisibility(View.GONE);
        }
    }

}
